package org.museum.api.client;

import org.common.util.Result;
import org.museum.api.util.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "action-inventory-service", path = "/actionInventory")
public interface ActionInventoryClient {
    @PostMapping("/{id}")
    Result deductActionTicket(@PathVariable("id") Integer id);

    @GetMapping("/getActionTicketPriceByIds")
    Result getActionTicketPriceByIds(@RequestParam("ids") List<Integer> ids);

    //根据票id获取actionId
    @GetMapping("/getActionIdById/{id}")
    CommonResponse<Integer> getActionIdById(@PathVariable("id") Integer id);

    //进行库存恢复
    @PostMapping("/restoreStock")
    CommonResponse<Integer> restoreStock(@RequestParam("ticketId") Integer ticketId);
}
